﻿<%@ WebHandler Language="C#" Class="GetName" %>

using System;
using System.Web;
using System.Data;
using BLL;
public class GetName : IHttpHandler
{

    public void ProcessRequest(HttpContext context)
    {
        context.Response.ContentType = "text/plain";
        string pat = context.Request.Params["word"].Trim();


        DataTable dt = new PublicSqlService().GetData("GoodsName", "Tbl_SplitBillGoods", "   GoodsName like  '%" + pat + "%'");

        string sql = "";
        foreach (DataRow dr in dt.Rows)
        {
            sql += "," + dr[0].ToString()+"";
        }

        if (sql.Trim() != "")
        {
            context.Response.Write(sql.Substring(1));
        }
        else
        {
            context.Response.Write("");
        }

    }

    public bool IsReusable
    {
        get
        {
            return false;
        }
    }

}